import request from "@/utils/request";

const squareApi = {
  // 列表
  list: async (params) => {
    return await request({
      url: "/app/photobook/selectPhotobook",
      method: "GET",
      params: params,
    });
  },
  // 详情
  info: async (params) => {
    console.log("info", params);
    return await request({
      url: "/app/photobook/queryById",
      method: "GET",
      params: params,
    });
  },
  // 收藏
  collect: async (params) => {
    return await request({
      url: "/app/photobookCollect/collect",
      method: "POST",
      data: params,
    });
  },
  // 购买
  buyPhotobook: async (id) => {
    return await request({
      url: `/app/photobook/buyPhotobook?id=${id}`,
      method: "GET",
    });
  },
};

export default squareApi;
